package thread;

public class SimpleThread extends Thread{
	public SimpleThread(String str) {
		super(str);
	}
	
	public void run() {
		for (int i=0; i<5; i++) {
			System.out.println(this.getName() + "= " + i);
			try {
				sleep( (int)(Math.random()*100) );
			}catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		System.out.println(this.getName() + "DONE");
	}
	
	public static void main(String[] args) {
		Thread t1 = new SimpleThread("Thread A ");
		Thread t2 = new SimpleThread("Thread B ");
		t1.start();
		t2.start();
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
	}
}
